package tako.wisers.com.android.apis.handler;


import android.content.Context;
import android.content.Intent;
import tako.wisers.com.android.apis.activity.ViewMap;
import tako.wisers.com.android.apis.event.MapRouteEvent;
import tako.wisers.com.android.apis.util.Global;

public class MapRouteHandler implements Handler<MapRouteEvent> {
	private Context mCxt;
	
	public MapRouteHandler(Context context){
		mCxt = context;
	}

	@Override
	public void execute(MapRouteEvent event) {
		Intent i = new Intent(mCxt, ViewMap.class);
		i.setFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
		
		i.putExtra(Global.LATITUDE_E6_EXTRA, event.getEndPoint().getLatitudeE6());
		i.putExtra(Global.LONGITUDE_E6_EXTRA, event.getEndPoint().getLongitudeE6());
		
		i.putExtra(Global.ROUTE_MODE, event.getId());

		mCxt.startActivity(i);
	}

}
